# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-py-zabbix
pkgname=('python2-py-zabbix' 'python-py-zabbix')
_pkgname=py-zabbix
pkgver=1.1.7
pkgrel=6
pkgdesc='Python module to work with zabbix.'
arch=('any')
url='https://pypi.org/project/py-zabbix/#files'
license=('GPL2')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('eaa8c5e5ad5604ad4ad41de439ab7856f6907346caa56bed67520df3316f313038e300cbf96f8389dca5be30079392406bcbb26f3ba40d2ef39ccd2fc99c11b6')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-py-zabbix() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-py-zabbix() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

